210 三角形判斷
side1 = eval(input().strip()) side2 = eval(input().strip()) side3 = eval(input().strip()) if (side1+side2)>side3 and (side2+side3)>side1 and (side3+side1)>side2 : print("%d" %(side1+side2+side3)) else: print("Invalid")
303 迴圈數值相乘
n = int(input().strip()) for i in range(1,n+1): for j in range(1,i+1): print("{:>4}".format(i*j),end="") print("")
繪製等腰中空三角形
for i in range(1,n): for x in range(n-i): print(' ',end="") for y in range(i*2-1): if y==0 or y==i*2-2: print('*',end="") else : print(" ",end="") print() for i in range(n*2-1): print("*",end="") print()
參考資料:TQC+ Python 3